package com.nwpu.coursesupport.exception;

import com.nwpu.coursesupport.entity.bean.Response;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class CurrencyExceptionHandler {
    @ResponseBody
    @ExceptionHandler(CurrencyException.class)
    public Response handler(CurrencyException e){
        return Response.ok(e.getMessage());
    }
}
